package com.second.app.thread.notifydemo;

/**
 * @Author soul gao
 * @Date 2021/1/24 12:03
 * 努力学习 天天进步
 */
public class Service {

    private  Object lock;

    public  void testMethod(Object lock){

        try {
            synchronized (lock){
                System.out.println(Thread.currentThread().getName()+":开始等待"+System.currentTimeMillis());
                lock.wait();
                System.out.println(Thread.currentThread().getName()+":结束等待"+System.currentTimeMillis());
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
